let app = getApp()
Component({
    properties: {
      vuetype:String,
      list:{
        type:Array,
        observer: function(newVal, oldVal) {
          this.update()
        }
      },
      },
      data:{
         is_common:true
      },
    lifetimes: {  
        attached: function () {
             if(this.data.vuetype=='goodsdetail'){
               this.setData({
                   is_common:false
               })
             }
       }
      },
    methods: {
      update:function(){
        var that=this
        var datalist=that.data.list
        for (var i = 0; i <datalist.length; i++) {
          var chiobj = {
            title:datalist[i].goods_name,
            pic:datalist[i].goods_pic,
            price:datalist[i].goods_price
           }
           var arr=[];
           arr.push(chiobj)
           datalist[i]['good_info']=arr; 
        }
        this.setData({
          list:datalist
        })
      }
    }
});
